package com.zyp.boot06.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BMIController {
    @RequestMapping("/bmi")
    public int bmi(double h, double w){
        double bmi = w/(h*h);
        if (bmi<=18.5){
            return 1;
        }
        if (bmi<=24){
            return 2;
        }
        if (bmi<=27){
            return 3;
        }
        return 4;
    }
}
